<template>
    <!--热门商户和商户列表-->
    <div class="iteminfo" v-if="isValidateArr(HotMap)">
        <div v-for="v in HotMap">
            <a href="javascript:void(0)" @click="routeToGoodsDetail(v)" class="infolist clearfix">
                <!--<div class="store-img"><img :src="getImgBaseUrl+v.pictureAddress" width="67" height="67"></div>-->
                <div class="store-img"><img :src="v.pictureAddress" width="67" height="67"></div>
                <div class="fr wp75">
                    <dl>
                        <dt>{{v.storeName}}</dt>
                        <dd>
                            <span>{{v.area}}</span>
                            <span>{{v.oneLevel[1]}}</span>
                        </dd>
                        <dd class="juli">
                            <span><em>{{v.consumption}}</em>/人</span>

                            <span v-if="1000<v.distance">{{Number((v.distance/1000).toFixed(1))}}km</span>
                            <span v-else>{{v.distance}}m</span>
                        </dd>
                    </dl>
                    <ul>
                        <li v-for="k in v.activity">
                              
                            <i v-if="k.activityId=='03'" class="all_bg hui"></i><!--闪惠活动图标-->
                            <i v-if="k.activityId=='06'" class="all_bg yin"></i><!--闪惠优惠券图标-->
                            <!-- <i v-if="k.activityType=='01'" class="all_bg yin"></i>
                            <i v-else-if="k.activityType=='02'" class="all_bg zhe"></i> -->
                            <span>{{k.activityName}}</span>
                        </li>
                    </ul>
                </div>
            </a>
        </div>
    </div>
    <div class="bg-gray" v-else>
        <div class="none-content">
            <img src="@/assets/images/store-none.png">
            <div class="txt">没有找到你要的商户</div>
        </div>
    </div>
</template>

<script>
    import {mapGetters} from 'vuex';
    import util from '@/util/util';
    export default {
        name: "customerList",
        methods:{
            //数组不为空大于0
            isValidateArr(arr){
                return util.isValidateArr(arr);
            },
            routeToGoodsDetail(v){
                //this.$store.commit('setGoodsOne',v);
                sessionStorage.setItem('goodsOne',JSON.stringify(v));
                this.$router.push({name:'goodsDetail'});
            }
        },
        computed:{
            ...mapGetters({
                HotMap:'getHotMap'
                //getImgBaseUrl:'getImgBaseUrl'
            })
        },
        mounted(){
            /*this.$store.dispatch('loadIndexData',params2).then(resp=>{
                this.$store.commit('setHotMap',resp.data);//只改变中间的内容
            });*/
        }
    }
</script>

<style scoped>

</style>
